{ "cells": [ { "cell_type": "markdown", "id": "fc399b10-900a-427f-9291-a0a547699198", "metadata": { "editable": true, "slideshow": { "slide_type": "slide" }, "tags": [] }, "source": [ "# Other options of deployment using `Streamlit` and `Heroku` -- Platform as a Service\n", "\n", "## ML Deployment using Streamlit" ] }, { "cell_type": "markdown", "id": "bef365fe-bf18-4d7d-a5c4-2eb2ca78e4b5", "metadata": { "editable": true, "slideshow": { "slide_type": "slide" }, "tags": [] }, "source": [ "### Deployment using Streamlit\n" ] }, { "cell_type": "markdown", "id": "12184d9c-82be-4f00-8757-e6770a1311b2", "metadata": { "editable": true, "slideshow": { "slide_type": "subslide" }, "tags": [] }, "source": [ "Streamlit\n", "- Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science.\n", "- In just a few minutes you can build and deploy powerful data apps. So [let's get started!](https://docs.streamlit.io/library/get-started/)" ] }, { "cell_type": "markdown", "id": "77723450-a86f-4f34-b61c-f1daba864c3a", "metadata": { "editable": true, "slideshow": { "slide_type": "subslide" }, "tags": [] }, "source": [ "Deployment of IRIS plan classification:\n", "\n", "- Using [IRIS dataset](https://www.kaggle.com/datasets/uciml/iris)\n", "- The Iris dataset was used in R.A. Fisher's classic 1936 paper.\n", "- The Use of Multiple Measurements in Taxonomic Problems, and can also be found on the UCI Machine Learning Repository.\n", "\n", "" ] }, { "cell_type": "markdown", "id": "32705a7c-a550-4d02-9468-d99d44fcd092", "metadata": { "editable": true, "slideshow": { "slide_type": "subslide" }, "tags": [] }, "source": [ "- It includes three iris species with 50 samples each as well as some properties about each flower.\n", "- One flower species is linearly separable from the other two, but the other two are not linearly separable from each other. \n", "\n", "The columns in this dataset are:\n", "\n", " Id\n", " SepalLengthCm\n", " SepalWidthCm\n", " PetalLengthCm\n", " PetalWidthCm\n", " Species" ] }, { "cell_type": "markdown", "id": "f10b35c6-3e3d-42f3-9056-3b106a414af5", "metadata": { "editable": true, "slideshow": { "slide_type": "subslide" }, "tags": [] }, "source": [ "#### Training the model" ] }, { "cell_type": "markdown", "id": "9f441830-339a-4db8-9a4f-6a6f835f5cb3", "metadata": { "editable": true, "slideshow": { "slide_type": "subslide" }, "tags": [] }, "source": [ "##### Import the data" ] }, { "cell_type": "code", "execution_count": 1, "id": "b6555231-a316-4d29-8ca7-342dfc598b91", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", " | Id | \n", "SepalLengthCm | \n", "SepalWidthCm | \n", "PetalLengthCm | \n", "PetalWidthCm | \n", "Species | \n", "
---|---|---|---|---|---|---|
0 | \n", "1 | \n", "5.1 | \n", "3.5 | \n", "1.4 | \n", "0.2 | \n", "Iris-setosa | \n", "
1 | \n", "2 | \n", "4.9 | \n", "3.0 | \n", "1.4 | \n", "0.2 | \n", "Iris-setosa | \n", "
2 | \n", "3 | \n", "4.7 | \n", "3.2 | \n", "1.3 | \n", "0.2 | \n", "Iris-setosa | \n", "
3 | \n", "4 | \n", "4.6 | \n", "3.1 | \n", "1.5 | \n", "0.2 | \n", "Iris-setosa | \n", "
4 | \n", "5 | \n", "5.0 | \n", "3.6 | \n", "1.4 | \n", "0.2 | \n", "Iris-setosa | \n", "